package cn.zptc.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import cn.zptc.bean.User;
import cn.zptc.example.Example;

public class DBUtilsExample {
    public List findAll() throws SQLException{
		QueryRunner runner = new QueryRunner(Example.getDataSource());
		String sql = "select * from users";
		List<User> list = (List<User>) runner.query(sql, new BeanListHandler(User.class));
		return list;
	}
}
